#!/usr/bin/env python
# -*- coding:utf-8 -*-
import requests
from bs4 import BeautifulSoup

r = requests.get('https://python123.io/ws/demo.html')
demo = r.text
soup = BeautifulSoup(demo, 'html.parser')
a = soup.find_all('a')
b = soup.find_all(['a', 'b'])
for tag in soup.find_all(True):
    print(tag.name)

# In[9]:soup.find_all('p','course')
# Out[9]: [<p class="course">Python is a
# wonderful general-purpose programming language. You can learn Python from
# novice to professional by tracking the following courses: <a class="py1"
# href="http://www.icourse163.org/course/BIT-268001" id="link1">Basic
# Python</a> and <a class="py2"
# href="http://www.icourse163.org/course/BIT-1001870001" id="link2">Advanced
# Python</a>.</p>] In[10]：soup.find_all( id='link1') Out[10]: [<a class="py1"
# href="http://www.icourse163.org/course/BIT-268001" id="link1">Basic
# Python</a>]
